import { HttpException, HttpStatus } from '@nestjs/common';

export type ExceptionData =
  | string
  | {
      type: ExceptionType.Grpc;
      data: string;
    };

export enum ExceptionType {
  Grpc,
}

export class AddonException extends HttpException {
  constructor(response: ExceptionData) {
    super(JSON.stringify(response), HttpStatus.INTERNAL_SERVER_ERROR);
  }
}
